package com.shsmi.dsn.service.Impl;

import cn.hutool.crypto.SecureUtil;
import com.shsmi.dsn.dao.SystemUserRepository;
import com.shsmi.dsn.domain.SystemUser;
import com.shsmi.dsn.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuthServiceImpl implements AuthService {
    @Autowired
    private SystemUserRepository repository;

    @Override
    public SystemUser verify(String loginName, String password) {
        SystemUser user = repository.findByLoginNameAndLoginPassword(loginName, SecureUtil.md5(password));
        return user;
    }
}
